import request from '@/utils/request'

// 用户主页
export function getInfoByName(username, page, size) {
  return request({
    url: '/ums/user/' + username,
    method: 'get',
    params: {
      pageNo: page,
      size: size
    }
  })
}
// 用户主页
export function getInfo() {
  return request({
    url: '/ums/user/info',
    method: 'get'
  })
}
// 更新
export function update(user) {
  return request({
    url: '/ums/user/update',
    method: 'post',
    data: user
  })
}
//获取签到日期
export function getDays(useId) {
  return request(({
    url: `/ums/user/days`,
    method: 'get',
    params: {userId:useId}
  }))
}
//添加签到日期
export function addDay(data) {
  return request(({
    url: `/ums/user/addDay`,
    method: 'post',
    data:data
  }))
}
//获取收藏夹
export function getCollections(useId) {
  return request(({
    url: `/ums/user/collections`,
    method: 'get',
    params: {userId:useId}
  }))
}
//添加收藏单词
export function addCollection(data){
  return request(({
    url: `/ums/user/addCollection`,
    method: 'post',
    data:data
  }))
}
export function deleteByWord(word){
  return request(({
    url: `/ums/user/delete`,
    method: 'get',
    params:{word}
  }))
}
export function sendMail(email,name,num){
  return request(({
    url: `/ums/user/mail`,
    method: 'get',
    params:{email,name,num}
  }))
}
export function sendPhone(phone){
  return request(({
    url: `/ums/user/phone`,
    method: 'get',
    params:{phone}
  }))
}
export function mail_v(msg,result,id){
  return request(({
    url: `/ums/user/mail_v`,
    method: 'get',
    params:{msg,result,id}
  }))
}
export function updatePass(pass,name){
  return request(({
    url: `/ums/user/updatePass`,
    method: 'post',
    params:{pass,name}
  }))
}
export function loginByEmailAndPhone(msg,result,name){
  return request(({
    url: `/ums/user/loginByEmailAndPhone`,
    method: 'get',
    params:{msg,result,name}
  }))
}